package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.system.SysShipline;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.mapper.SysShiplineMapper;
import com.ruoyi.system.service.ISysShiplineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 自动航线Service业务层处理
 *
 * @author zjw
 * @date 2023-07-05
 */
@Service
public class SysShiplineServiceImpl implements ISysShiplineService {
    @Autowired
    private SysShiplineMapper sysShiplineMapper;

    /**
     * 查询自动航线
     *
     * @param shiplineId 自动航线主键
     * @return 自动航线
     */
    @Override
    public SysShipline selectSysShiplineByShiplineId(Long shiplineId) {
        return sysShiplineMapper.selectSysShiplineByShiplineId(shiplineId);
    }

    /**
     * 查询自动航线列表
     *
     * @param sysShipline 自动航线
     * @return 自动航线
     */
    @Override
    public List<SysShipline> selectSysShiplineList(SysShipline sysShipline) {
        return sysShiplineMapper.selectSysShiplineList(sysShipline);
    }

    /**
     * 新增自动航线
     *
     * @param sysShipline 自动航线
     * @return 结果
     */
    @Override
    public int insertSysShipline(SysShipline sysShipline) {
        return sysShiplineMapper.insertSysShipline(sysShipline);
    }

    /**
     * 修改自动航线
     *
     * @param sysShipline 自动航线
     * @return 结果
     */
    @Override
    public int updateSysShipline(SysShipline sysShipline) {
        sysShipline.setUpdateTime(DateUtils.getNowDate());
        return sysShiplineMapper.updateSysShipline(sysShipline);
    }

    /**
     * 批量删除自动航线
     *
     * @param shiplineIds 需要删除的自动航线主键
     * @return 结果
     */
    @Override
    public int deleteSysShiplineByShiplineIds(Long[] shiplineIds) {
        return sysShiplineMapper.deleteSysShiplineByShiplineIds(shiplineIds);
    }

    /**
     * 删除自动航线信息
     *
     * @param shiplineId 自动航线主键
     * @return 结果
     */
    @Override
    public int deleteSysShiplineByShiplineId(Long shiplineId) {
        return sysShiplineMapper.deleteSysShiplineByShiplineId(shiplineId);
    }

    @Override
    public List<SysShipline> selectShiplineListByScenicId(Long scenicId) {
        return sysShiplineMapper.getShiplineListByScenicId(scenicId);
    }
}
